/*

	Hernan Rivas Acosta
		hernanrivasacosta@gmail.com

	Licenced under the Mozilla Public Licence
		http://www.mozilla.org/MPL/MPL-1.1.html

	Hosted on Google Code
		http://code.google.com/p/as3localization/

*/
package org.her.localization.utils.parsers
{
	/**
	 * @private
	 */
	public final class BasicParser implements IParser
	{

		// NOTE: this class is not accesible in the final release.
		public function BasicParser()
		{
		}

		public function parse (xml:XML, addValue:Function, setId:Function = null):void
		{
			var texts:XMLList, i:int, l:int;

			setId(xml.info.@langId);

			texts = xml.texts.text;

			l = texts.length();
			for (i = 0; i < l; i++)
			{
				addValue(texts[i].@id, texts[i].@text);
			}
		}

	}
}